<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qjsengine.cpp -->
  <title>QJSEngine的废弃成员 | Qt QML 5.12.3</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.12</a></td><td ><a href="qtqml-index.html">Qt QML</a></td><td ><a href="qtqml-module.html">C++ 类</a></td><td >QJSEngine</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtqml-index.html">Qt 5.12.3 参考指南</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QJSEngine的废弃成员</h1>
<p><b>以下来自<a href="qjsengine.html">QJSEngine</a>的成员已废弃。提供它们是为了让旧的源代码继续工作。我们强烈建议不要在新代码中使用它们。</p>
<h2>公用函数</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code></td><td class="memItemRight bottomAlign"><b><a href="../qtcore/qobject-obsolete.html#dumpObjectInfo-1">dumpObjectInfo</a></b>()</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code></td><td class="memItemRight bottomAlign"><b><a href="../qtcore/qobject-obsolete.html#dumpObjectTree-1">dumpObjectTree</a></b>()</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> <code>(obsolete) </code>void </td><td class="memItemRight bottomAlign"><b><a href="qjsengine-obsolete.html#installTranslatorFunctions">installTranslatorFunctions</a></b>(const QJSValue &amp;<i>object</i> = QJSValue())</td></tr>
</table></div>
<h2>成员函数文档</h2>
<!-- $$$installTranslatorFunctions[overload1]$$$installTranslatorFunctionsconstQJSValue& -->
<h3 class="fn" id="installTranslatorFunctions"><a name="installTranslatorFunctions"></a><span class="type">void</span> QJSEngine::<span class="name">installTranslatorFunctions</span>(const <span class="type"><a href="qjsvalue.html">QJSValue</a></span> &amp;<i>object</i> = QJSValue())</h3>
<p>此函数已过时。提供它是为了保持旧的源代码工作。我们强烈建议不要在新代码中使用它。</p>
<p>在给定对象上安装翻译程序函数，如果没有指定<i>object（对象）</i>，则在全局对象上安装翻译程序函数。</p>
<p>脚本翻译器函数与C++翻译器函数的关系如下表所示:</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >脚本函数</th><th >对应的C++函数</th></tr></thead>
<tr valign="top" class="odd"><td >qsTr()</td><td ><a href="../qtcore/qobject.html#tr">QObject::tr</a>()</td></tr>
<tr valign="top" class="even"><td ><a href="../qtcore/qtglobal.html#QT_TR_NOOP">QT_TR_NOOP</a>()</td><td ><a href="../qtcore/qtglobal.html#QT_TR_NOOP">QT_TR_NOOP</a>()</td></tr>
<tr valign="top" class="odd"><td >qsTranslate()</td><td ><a href="../qtcore/qcoreapplication-obsolete.html#translate-1">QCoreApplication::translate</a>()</td></tr>
<tr valign="top" class="even"><td ><a href="../qtcore/qtglobal.html#QT_TRANSLATE_NOOP">QT_TRANSLATE_NOOP</a>()</td><td ><a href="../qtcore/qtglobal.html#QT_TRANSLATE_NOOP">QT_TRANSLATE_NOOP</a>()</td></tr>
<tr valign="top" class="odd"><td >qsTrId()</td><td ><a href="../qtcore/qtglobal.html#qtTrId">qtTrId</a>()</td></tr>
<tr valign="top" class="even"><td ><a href="../qtcore/qtglobal.html#QT_TRID_NOOP">QT_TRID_NOOP</a>()</td><td ><a href="../qtcore/qtglobal.html#QT_TRID_NOOP">QT_TRID_NOOP</a>()</td></tr>
</table></div>
<p>它还向字符串原型中添加了一个arg()方法。</p>
<p>这个函数是在Qt 5.4中引入的。</p>
<p><b>请参考</b><a href="../qtdoc/internationalization.html">国际化与Qt</a>。</p>
<!-- @@@installTranslatorFunctions -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
